This example demonstrates the implementation of User routine for the velocity of the tool to follow Sine Curve.

Sine Curve Velocity Movement:

Sine wave formula = Amplitude*SIN(omega*time)    
Assuming omega =2*3.14158, 
Amplitude (max velocity) =A  will be read from GUI into routine using the Code:

CHARACTER*80 IUSRVL
COMMON /IUSR/ IUSRVL(10)

READ(IUSRVL(1),*) A


The usr_dsp.f file contains user routine implemented in 


C********************************************************************

      SUBROUTINE DIESP2(TIME,PDIS,VX,VY,STRKX,STRKY,FRZX,FRZY,AVGSRT,
     +            SRTMX,TMPMX,UPDV,UPDF,DTIME)

C********************************************************************
C
C
C
C********************************************************************

      IMPLICIT INTEGER*4 (I,J,K,L,M,N), REAL*8 (A-H,O-Z)
C
C ****    USER DEFINED VARIABLES ****
C
      CHARACTER*80 IUSRVL
      COMMON /IUSR/ IUSRVL(10)
C     
C     TO READ DATA (10 RESERVED LINES)
C        READ(IUSRVL(LINE NUMBER),*) DATA1,DATA2,DATA3...
C
C     TO WRITE DATA (10 RESERVED LINES)
C        WRITE(IUSRVL(LINE NUMBER),*) NEWDATA1, NEWDATA2, NEWDATA3 ...
C
C ****     END    ****
C
C     SEE "DIESP1" FOR DETAILED IMPLEMENTATION
C       
C Sine wave formula = Amplitude*SIN(omega*time)    
C Assuming omega =2*3.14158, 
C Amplitude =A (User to be define the Amplitude (max velocity) from GUI)
C 
           READ(IUSRVL(1),*) A
           B= A*(SIN( 2*3.14158*TIME))
           UPDV=(ABS(B))   
           RETURN
           END
C********************************************************************


Executing the User routine:

Open the pre-processor and import 2d_Dsp_SI.KEY file from 2D_Examples folder.

Go to Top die Movement controls tab and select Speed movement. Select user routine for Speed and enter routine number as 2. 

Go to Simulation controls and select Advanced User defined tab. In first row enter max speed amplitude input as 2.0.

Save the Key file and Generate DB. 

Make a copy of the release folder …\2D\UserRoutine\DEF_SIM (with usr_dsp.f modified as indicated above)

Open the FORTRAN Absoft 11 and open the DEFORM 2d user routine DEF_SIM_USR_Absoftv110.atools file from this copied location, 
and build local FEM engine DEF_SIM.EXE

Two ways to run this model using the user defined die speed model 
1. 
Build the executing files and paste the generated DEF_SIM.EXE in "..\2D\" folder. (first backup release version of DEF_SIM.EXE)
Run the simulation and observe die speed vs time in post processor after the completion of simulation.
2. 
create a file DEF_SIM_DIR.DAT with first line indicating the path to the folder holding this newly build DEF_SIM.EXE
Run the simulation and observe die speed behavior in post processor after the completion of simulation.
